package section_01.file;

import java.util.Arrays;
import java.util.List;
import java.util.function.Predicate;

public class LambdaTest {
	public static void main(String[] args) {
		List<String> language = Arrays.asList("java", "scala", "c++", "haskell", "lisp");
		// filter(language, (str) -> str.length() > 4);

		Predicate<String> startWithJ = n -> n.startsWith("j");
		Predicate<String> fourLetterLong = n -> n.length() > 4;
		language.stream().filter(startWithJ.or(fourLetterLong)).forEach((name) -> {
			System.out.println(name + "");
		});

	}

	public static void filter(List<String> names, Predicate<String> condition) {
		// names.stream().filter((name) ->
		// (condition.test(name))).forEach((name) -> {
		// System.out.println(name + " ");
		// });

	}
}
